package com.itydl.a03.domain;

import com.itydl.a03.utils.PinYinUtils;

/**
 * @author ydl
 * @version 联系人Bean
 */

public class Person implements Comparable<Person>{
    private String name;
    private String pinyin;

    public Person(String name) {
        this.name = name;
        this.pinyin = PinYinUtils.getyPinyin(name);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPinyin() {
        return pinyin;
    }

    public void setPinyin(String pinyin) {
        this.pinyin = pinyin;
    }

    @Override
    public int compareTo(Person other) {
        return pinyin.compareTo(other.pinyin);
    }
}
